//
//  MassTextController.m
//  毕业设计
//
//  Created by 龙波 on 2017/9/7.
//  Copyright © 2017年 吴添培. All rights reserved.
//

#import "MassTextController.h"
#import "MassTableViewCell.h"
#import "MassPersonCell.h"

#define kmasstabeleCell @"masstableCellID"
#define kmasspersonCell @"masspersonCelID"
@interface MassTextController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong) NSArray *getArray;

@end

@implementation MassTextController


-(instancetype)initWithFrame:(CGRect)frame WithArray:(NSArray *)array
{
    if (self = [super init]) {
        self.view.frame = frame;
        self.view.backgroundColor = [UIColor whiteColor];
       // self.getArray = [NSArray arrayWithObject:array];
      // NSLog(@"传过来了数组个数%@",self.getArray,self.getArray.count);
        
        self.navigationItem.title = @"xx社团";
        
        UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, 200)];
        headView.backgroundColor = [UIColor greenColor];
       // [self.view addSubview:headView];
        
        UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREENHEIGHT -20)];
        tableView.delegate = self;
        tableView.dataSource = self;
        
        [tableView registerClass:[MassPersonCell class] forCellReuseIdentifier: kmasspersonCell];
        [tableView registerClass:[MassTableViewCell class] forCellReuseIdentifier: kmasstabeleCell];
        
        tableView.tableHeaderView = headView;
        
        [self.view addSubview:tableView];
        
        
        
    }
    return  self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 1;
    }
    return 10;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        return 100;
    }
    return 150;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath  
{
    if (indexPath.section == 0) {
        MassPersonCell *cell = [MassPersonCell cellWithTableView:tableView];
        return cell;
    }else
    {
    MassTableViewCell *cell = [MassTableViewCell cellWithTabelView:tableView];
    return cell;
    }
}





@end
